<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/11/4
 * Time: 15:56
 */

namespace app\index\controller;


use think\Db;

class Search extends Base
{
    public  function  search(){
        $des = input('edtSearch');
        $art = Db::name('article')
            ->alias('a')
            ->join('cata c','a.cataid = c.cataid','left')
            ->where('a.arttitle|c.cataname|a.tag','like','%'.$des.'%')
            ->paginate(5);
//        var_dump($art);die();
        $this->assign('art',$art);
        return $this->fetch('index/search/search');
    }
}